package com.wyp168.leetcode;

public class respaceString {
    public static void main(String[] args) {
        int is = indexStringChar("leettttt");
        System.out.println(is);
    }

    public static int indexStringChar(String s) {
        char[] chars = s.toCharArray();

        for (int i = 0; i < chars.length; i++) {
            if (s.indexOf(chars[i]) == s.lastIndexOf(chars[i])) {
                return i + 1;
            }
        }
        return -1;
    }
}
